package com.j283_5.wisdom_park.controller.confcenter_management.resinfomanage;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.j283_5.wisdom_park.common.result.ResultData;
import com.j283_5.wisdom_park.pojo.Resinfomanage;
import com.j283_5.wisdom_park.pojo.Roleinfo;
import com.j283_5.wisdom_park.service.ResinfomanageService;
import com.j283_5.wisdom_park.vo.confcenter_management.ResInfoManageVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/resinfomanage")
@Api(value = "资源管理",tags = "资源管理",produces = "罗移筵")
public class ResinfomanageController {
    @Resource
    private ResinfomanageService resinfomanageService;
    /**
     * 查询所有资源信息
     * @param page
     * @param resinfomanage
     * @return
     */
    @RequestMapping(value = "/resInfoManage",method = RequestMethod.GET)
    @ApiOperation(value = "查询所有资源信息",notes = "查询所有资源信息（分页）",produces = "罗移筵",response = ResultData.class)
    public ResultData resInfoManage(@Param("page") Page<Resinfomanage> page, Resinfomanage resinfomanage){
        return resinfomanageService.resInfoManage(page,resinfomanage);
    }

    /**
     * 添加资源信息
     * @param resInfoManageVo
     * @return
     */
    @RequestMapping(value = "/addResInfo",method = RequestMethod.POST)
    @ApiOperation(value = "添加资源信息",notes = "添加资源信息",produces = "罗移筵",response = ResultData.class)
    public ResultData addResInfo(@RequestBody ResInfoManageVo resInfoManageVo){
        return resinfomanageService.addResInfo(resInfoManageVo);
    }

    /**
     * 删除资源信息
     * @param reIdlist
     * @return
     */
    @RequestMapping(value = "/deleteResInfo",method = RequestMethod.POST)
    @ApiOperation(value = "删除资源信息",notes = "删除资源信息",produces = "罗移筵",response = ResultData.class)
    public ResultData deleteResInfo(@RequestBody ArrayList<Integer> reIdlist){
        return resinfomanageService.deleteResInfo(reIdlist);
    }

    /**
     * 修改资源信息
     * @param resInfoManage
     * @return
     */
    @RequestMapping(value = "/updateResInfo",method = RequestMethod.POST)
    @ApiOperation(value = "修改资源信息",notes = "修改资源信息",produces = "罗移筵",response = ResultData.class)
    public ResultData updateResInfo(@RequestBody Resinfomanage resInfoManage){
        return resinfomanageService.updateResInfo(resInfoManage);
    }

}
